//
//  CJsecondViewController.m
//  同学录
//
//  Created by administrator on 13-8-6.
//  Copyright (c) 2013年 gyl. All rights reserved.
//

#import "CJsecondViewController.h"

@interface CJsecondViewController ()

@end

@implementation CJsecondViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}



- (IBAction)nextBtn:(id)sender {
    self.k++;
    [self animeImages];
    if(self.k<5)
    {
         self.imageshow.image=[_imagesarray objectAtIndex:self.k];
        
    }
    if(self.k==5)
    {        
        UIAlertView *p3=[[UIAlertView alloc]initWithTitle:@"player" message:@"it's over" delegate:nil cancelButtonTitle:@"YES" otherButtonTitles:nil, nil];
        [p3 show];
        [self performSegueWithIdentifier:@"animetonext" sender:sender];
    }
}

- (IBAction)phototake:(id)sender {
    
   

}

-(void)animeImages
{
    _imagesarray=[[NSMutableArray alloc] initWithCapacity:5];
    [_imagesarray addObject:[UIImage imageNamed:@"11.jpg"]];
    [_imagesarray addObject:[UIImage imageNamed:@"12.jpg"]];
    [_imagesarray addObject:[UIImage imageNamed:@"13.jpg"]];
    [_imagesarray addObject:[UIImage imageNamed:@"14.jpg"]];
    [_imagesarray addObject:[UIImage imageNamed:@"11.jpg"]];                                             
}

-(void)simpleImages
{
    _imagesarray=[[NSMutableArray alloc] initWithCapacity:5];
    [_imagesarray addObject:[UIImage imageNamed:@"5.jpg"]];
    [_imagesarray addObject:[UIImage imageNamed:@"6.jpg"]];
    [_imagesarray addObject:[UIImage imageNamed:@"7.jpg"]];
    [_imagesarray addObject:[UIImage imageNamed:@"8.jpg"]];
    [_imagesarray addObject:[UIImage imageNamed:@"9.jpg"]];
    
}

-(void)dreamImages
{
    _imagesarray=[[NSMutableArray alloc] initWithCapacity:5];
    [_imagesarray addObject:[UIImage imageNamed:@"0.jpg"]];
    [_imagesarray addObject:[UIImage imageNamed:@"1.jpg"]];
    [_imagesarray addObject:[UIImage imageNamed:@"2.jpg"]];
    [_imagesarray addObject:[UIImage imageNamed:@"3.jpg"]];
    [_imagesarray addObject:[UIImage imageNamed:@"4.jpg"]];
    
}

- (void)viewDidLoad
{
    _labtag.text=_tag;
    [super viewDidLoad];
    if([self.tag isEqualToString:@"animeToOne"])
    {
        [self animeImages];
        self.imageshow.image=[_imagesarray objectAtIndex:0];
        return;
    }
    else if ([self.tag isEqualToString:@"simpletotwo"])
    {
        [self simpleImages];
        self.imageshow.image=[_imagesarray objectAtIndex:0];
        return;
        
    }
    else if ([self.tag isEqualToString:@"dreamToThree"])
    {
        [self dreamImages];
        self.imageshow.image=[_imagesarray objectAtIndex:0];
        return;
        
    }
    else if ([self.tag isEqualToString:@"viewToFour"])
    {
        
    }
    else if ([self.tag isEqualToString:@"artToFive"])
    {
        
    }
    else
    {
        
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
